package com.sbtr.config;

import io.minio.MinioClient;
import lombok.Data;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
@EnableConfigurationProperties
public class MinioConfig {

    private String endpoint="http://10.17.157.85:9000/";
    private String accessKey="admin";
    private String secretKey="admin123456";

    @Bean
    public MinioClient getMinioClient(){
//        System.out.println("endpoint:"+endpoint);
        MinioClient minioClient = MinioClient.builder()
                .endpoint(endpoint)
                .credentials(accessKey,secretKey)
                .build();
        return minioClient;
    }
}